{%extends "base/page.html"%}
{% load pgfilters %}
{%block title%}Password reset{%endblock%}
{%block contents%}

{% if validlink %}

<h1>Enter new password <i class="fas fa-key"></i></h1>

<p>Please enter your new password twice so we can verify you typed it in correctly.</p>

<form action="" method="post">
  {% csrf_token %}
  <div class="form-group row">
    {% if form.new_password1.errors %}
      {% for e in form.new_password1.errors %}
        <div class="col-lg-12 alert alert-danger">{{e}}</div>
      {% endfor %}
    {% endif %}
    <label class="col-form-label col-sm-3" for="id_new_password1">New Password:</label>
    <div class="col-sm-9">
      {{ form.new_password1|field_class:"form-control" }}
    </div>
  </div>
  <div class="form-group row">
    {% if form.new_password2.errors %}
      {% for e in form.new_password2.errors %}
        <div class="col-lg-12 alert alert-danger">{{e}}</div>
      {% endfor %}
    {% endif %}
    <label class="col-form-label col-sm-3" for="id_new_password2">Confirm New Password:</label>
    <div class="col-sm-9">
      {{ form.new_password2|field_class:"form-control" }}
    </div>
  </div>
  <div class="submit-row">
    <label>&nbsp;</label><input class="btn btn-primary" type="submit" value="Change Password" />
  </div>
</form>

{% else %}

<h1>Password reset unsuccessful <i class="fas fa-key"></i></h1>

<p>The password reset link was invalid, possibly because it has already been used.  Please request a new password reset.</p>

{% endif %}

{% endblock %}
